//:C07:exec_7_2.c
// select method sort.
#include <stdio.h>
void sort_selet(int arr[])
{
    int i,j,marker, tmp;
    //marker = 0;

    for(i = 0; i < 9; i++)
    {
        marker = i;
        for(j = i + 1; j < 10; j++)
        {
            if(arr[marker] > arr[j])
            {
                marker = j;
            }
        }
        if(i != marker)
        {
            tmp = arr[i];
            arr[i] = arr[marker];
            arr[marker] = tmp;
        }
    }
}

int main(void)
{
    int i;
    int arr[] = {89,28,95,-23,3,1,2,-24,-79,-100};
    sort_selet(arr);
    for(i = 0; i < 10; i++)
    {
        printf("%d ", arr[i]);
    }
    printf("\n");
}